package Controller.SiteController;

import Utils.BaseMessage;
import ViewOption.siteVo;
import com.alibaba.fastjson.JSON;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "getSiteServlet", urlPatterns = {
        "/api/Site/getSiteServlet"
})
public class getSiteServlet extends HttpServlet {
    private final siteVo siteVo = new siteVo();

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.getWriter().print(JSON.toJSONString(new BaseMessage(0, null, siteVo.getSiteAll())));
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }
}
